package homework.api02.homework_api02;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "abc123def456hij";
        str = str.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(str);

        //和谐用语
        String regex = "(sha|nm|sb)";
        String message = "你sha,你是sb";
        message = message.replaceAll(regex,"***");
        System.out.println(message);
    }
}
